import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '成立时间',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '团队名称',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '团队编号',
    align:"center",
    dataIndex: 'teamNo'
   },
   {
    title: '团队长',
    align:"center",
    dataIndex: 'adminId_dictText'
   },
   {
    title: '团队类型',
    align:"center",
    dataIndex: 'teamType_dictText'
   },
   {
    title: '团队销售额',
    align:"center",
    sorter: true,
    dataIndex: 'teamSale'
   },
   {
    title: '团队总佣金',
    align:"center",
    sorter: true,
    dataIndex: 'teamCommission'
   },
   {
    title: '已提现佣金',
    align:"center",
    sorter: true,
    dataIndex: 'teamCommissionWithdrawn'
   },
   {
    title: '团队成员数',
    align:"center",
    sorter: true,
    dataIndex: 'teamUserNum'
   },
   {
    title: '团队订单量',
    align:"center",
    sorter: true,
    dataIndex: 'teamOrderNum'
   },
   {
    title: '租户',
    align:"center",
    dataIndex: 'tenantId'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "团队长",
      field: 'adminId',
      component: 'JSearchSelect',
      componentProps:{
         dict:"couple_user,nick_name,id"
      },
      //colProps: {span: 6},
 	},
	{
      label: "团队类型",
      field: 'teamType',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"team_type"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '团队名称',
    field: 'title',
    component: 'Input',
  },
  {
    label: '团队长',
    field: 'adminId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"BS_UserLayout_AgentInfors,realname,id",
	   pageSize:10,
	   async:true
    },
  },
  {
    label: '团队类型',
    field: 'teamType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"team_type"
     },
  },
  {
    label: '团队销售额',
    field: 'teamSale',
    component: 'InputNumber',
  },
  {
    label: '团队总佣金',
    field: 'teamCommission',
    component: 'InputNumber',
  },
  {
    label: '已提现佣金',
    field: 'teamCommissionWithdrawn',
    component: 'InputNumber',
  },
  {
    label: '团队成员数',
    field: 'teamUserNum',
    component: 'InputNumber',
  },
  {
    label: '团队订单量',
    field: 'teamOrderNum',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
	{
	  label: '',
	  field: 'teamNo',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}